#ifndef BUTTON_ON_OFF_H
#define BUTTON_ON_OFF_H

#include <QWidget>
#include "button_cust_base.h"

class Button_On_Off : public Button_Cust_Base
{
    Q_OBJECT
public:
    explicit Button_On_Off(QWidget *parent = nullptr);

signals:
    // 点击信号
    void sig_on_off(bool isOpen);
protected:
    // 开关状态
    bool isOpen = false; // 初始状态为关灯

    // 鼠标进入
    void enterEvent(QEvent *event);

    // 鼠标离开
    void leaveEvent(QEvent *event);

    // 鼠标按下
    void mousePressEvent(QMouseEvent *event);

    // 鼠标释放
    void mouseReleaseEvent(QMouseEvent *event);

};

#endif // BUTTON_ON_OFF_H
